﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="AdsReport.aspx.cs" Inherits="FYPHP.Reports.AdsReport" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="LeftContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript">    var num = 0; </script>
<h2>Report for Advertisements</h2>
<table>
<tr><td>Type</td><td>:</td>
<td><asp:RadioButtonList ID="RadioButtonList1" runat="server" 
        RepeatDirection="Horizontal" AutoPostBack="True" 
            onselectedindexchanged="RadioButtonList1_SelectedIndexChanged">
        <asp:ListItem Value="Daily" Selected="True">Daily</asp:ListItem>
        <asp:ListItem Value="Monthly">Monthly</asp:ListItem>
        <asp:ListItem Value="Yearly">Yearly</asp:ListItem>
</asp:RadioButtonList></td></tr>
<tr><td>Sort by</td><td>:</td>
<td><asp:DropDownList ID="DropDownList1" runat="server">
    </asp:DropDownList>
    <asp:CheckBox ID="CheckBox1" runat="server" Text="Descending" style="font-size: 12px;" /></td></tr>

    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <asp:Panel ID="Panel1" runat="server" Visible="False">
    <tr><td>From Date</td><td>:</td><td>
    <asp:TextBox ID="TextBox1" runat="server" AutoCompleteType="Disabled"></asp:TextBox>
    <ajaxToolkit:CalendarExtender ID="CalendarExtenderDM" runat="server"
            TargetControlID="TextBox1" Format="dd/MM/yyyy" /></td></tr>
    <tr><td>To Date</td><td>:</td><td>
    <asp:TextBox ID="TextBox3" runat="server" AutoCompleteType="Disabled"></asp:TextBox>
    <ajaxToolkit:CalendarExtender ID="CalendarExtender2" runat="server"
            TargetControlID="TextBox3" Format="dd/MM/yyyy" /></td></tr>
    </asp:Panel>

    <asp:Panel ID="Panel2" runat="server" Visible="False">
    <tr><td>Month</td><td>:</td><td>
        <asp:DropDownList ID="ddlMonth" runat="server">
        </asp:DropDownList>
    </td></tr>
    </asp:Panel>
    <tr><td colspan="2"></td><td>
    <asp:Button ID="btnSort" runat="server" Text="View Report" onclick="btnSort_Click" /></td></tr>
</table>    
    <asp:MultiView ID="MultiView1" runat="server">
        <asp:View ID="View1" runat="server">
        <asp:Repeater ID="ItemList" runat="server">
<HeaderTemplate>
<table cellpadding="5" cellspacing="5" width="722" border="1px solid #ffffff" align="center" style="border-collapse: collapse; border-color: #aaaaaa; text-align: center; margin-top: 5px">
 <tr style="background-color: #eee; font-weight: bold;"><td width="30px">No.</td><td>Date</td><td>Advertisement Link</td><td>Duration</td><td>Status</td><td>Price</td></tr>

</HeaderTemplate>
<ItemTemplate>
     <tr>
     <td><script type="text/javascript">num += 1; document.write(num);</script></td>
     <td width="80"><%#DataBinder.Eval(Container.DataItem, "adate" ) %></td>
            <td><%#DataBinder.Eval(Container.DataItem, "a_link" ) %></td>
            <td width="80"><%#DataBinder.Eval(Container.DataItem, "a_duration" ) %></td>
            <td width="80" style="text-transform:capitalize;r"><%#DataBinder.Eval(Container.DataItem, "a_status" ) %></td>
            <td width="80">$<%#DataBinder.Eval(Container.DataItem, "a_price" ) %></td>
        </tr>
   </ItemTemplate>

   <FooterTemplate>
    </FooterTemplate>
</asp:Repeater> 
<tr style="font-weight: bold;"><td colspan="5" align="right">Total</td>
<td>$<asp:Label ID="lblTearn" runat="server"></asp:Label></td></tr>
</table>
        </asp:View>

        <asp:View ID="View2" runat="server">
        <asp:Repeater ID="ItemList2" runat="server">
<HeaderTemplate>
<table cellpadding="5" cellspacing="5" width="722" border="1px solid #ffffff" align="center" style="border-collapse: collapse; border-color: #aaaaaa; text-align: center; margin-top: 5px">
 <tr style="background-color: #eee; font-weight: bold;"><td width="30px">No.</td><td>Year</td><td>Month</td><td>Total Advertisements</td><td>Total Earning</td></tr>

</HeaderTemplate>
<ItemTemplate>
     <tr>
     <td><script type="text/javascript">num += 1; document.write(num);</script></td>
     <td width="150"><%#DataBinder.Eval(Container.DataItem, "tyear" ) %></td>
     <td width="150"><%#DataBinder.Eval(Container.DataItem, "tmonth" ) %></td>
     <td><%#DataBinder.Eval(Container.DataItem, "tads" ) %></td>
     <td>$<%#DataBinder.Eval(Container.DataItem, "tearn" ) %></td>
        </tr>
   </ItemTemplate>

   <FooterTemplate>
    </FooterTemplate>
</asp:Repeater> 
<tr style="font-weight: bold;"><td colspan="3" align="right">Total</td>
<td><asp:Label ID="lblTads2" runat="server"></asp:Label></td>
<td>$<asp:Label ID="lblTotal2" runat="server"></asp:Label></td></tr></table>
        </asp:View>

        <asp:View ID="View3" runat="server">
        <asp:Repeater ID="ItemList3" runat="server">
<HeaderTemplate>
<table cellpadding="5" cellspacing="5" width="722" border="1px solid #ffffff" align="center" style="border-collapse: collapse; border-color: #aaaaaa; text-align: center; margin-top: 5px">
 <tr style="background-color: #eee; font-weight: bold;"><td width="30px">No.</td><td>Year</td><td>Total Advertisements</td><td>Total Earning</td></tr>

</HeaderTemplate>
<ItemTemplate>
     <tr>
     <td><script type="text/javascript">             num += 1; document.write(num);</script></td>
     <td width="150"><%#DataBinder.Eval(Container.DataItem, "tyear" ) %></td>
     <td><%#DataBinder.Eval(Container.DataItem, "tads" ) %></td>
     <td>$<%#DataBinder.Eval(Container.DataItem, "tearn" ) %></td>
        </tr>
   </ItemTemplate>

   <FooterTemplate>
    </FooterTemplate>
</asp:Repeater> 
<tr style="font-weight: bold;"><td colspan="2" align="right">Total</td>
<td><asp:Label ID="lblTads3" runat="server"></asp:Label></td>
<td>$<asp:Label ID="lblTotal3" runat="server"></asp:Label></td></tr></table>
        </asp:View>
    </asp:MultiView>
</asp:Content>
